{extend name="base" /}
{block name="content"}
<div class="g-main">
    <div class="m-main-title">
        <div class="m-container-fluid">
            <a href="{:url('index/welcome')}"><i class="icon icon-home"></i>首页</a>
            <span class="icon-angle-right"></span>
            <span>系统</span>
            <span class="icon-angle-right"></span>
            <span>系统设置</span>
            <span class="icon-angle-right"></span>
            <a href="{:url('index')}">后台菜单管理</a>
            <span class="icon-angle-right"></span>
            <span>{$info ? '编辑' : '添加'}后台菜单</span>
            <a class="u-flush"><i class="icon-repeat"></i></a>
        </div>
    </div>
    <div class="m-main-content">
        <div class="m-container">
            <div class="m-form">
                <form class="layui-form" id="j_form">
                    <table class="m-table">
                        <thead>
                            <tr>
                                <th colspan="2">{$info ? '编辑' : '添加'}后台菜单</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td width="15%"><label for="name">菜单名称<em>*</em></label></td>
                                <td><input type="text" class="u-ipt u-ipt-long" name="name" id="name" placeholder="请输入菜单名称" value="{$info.name}" /></td>
                            </tr>
                            <tr>
                                <td><label>上级菜单</label></td>
                                <td>
                                    <div class="lay-select">
                                        <select name="parent_id">
                                            <option value="0">顶级菜单</option>
                                            {foreach name="menus" item="menu"}
                                            <option value="{$menu.id}"{if condition="($info.parent_id eq $menu.id) OR ($menu.id eq $pid)"} selected{/if}>{$menu.html|html_entity_decode}|- {$menu.name}</option>
                                            {/foreach}
                                        </select>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td><label for="icon">图标</label></td>
                                <td><input type="text" class="u-ipt u-ipt-long" name="icon" id="icon" placeholder="请输入图标类名" value="{$info.icon}" /><span>http://www.bootcss.com/p/font-awesome/ 如：icon-cogs</span></td>
                            </tr>
                            <tr>
                                <td><label for="url">链接</label></td>
                                <td><input type="text" class="u-ipt u-ipt-long" name="url" id="url" placeholder="请输入链接地址" value="{$info.url}" /><span>如：/manage/admin_menus/index</span></td>
                            </tr>
                            <tr>
                                <td><label>状态</label></td>
                                <td>
                                    <input type="radio" name="status" value="0" title="显示"{if condition="!$info || $info['status'] eq 0"} checked{/if} />
                                    <input type="radio" name="status" value="1" title="隐藏"{if condition="$info && $info['status'] eq 1"} checked{/if} />
                                </td>
                            </tr>
                            <tr>
                                <td><label for="list_order">排序值</label></td>
                                <td><input type="text" class="u-ipt u-ipt-tiny" name="list_order" id="list_order" placeholder="请输入排序值" value="{$info.list_order ?: 0}" /><span>值越大越排在前面</span></td>
                            </tr>
                            <tr>
                                <td><label for="remark">备注</label></td>
                                <td><div class="m-textarea"><textarea name="remark" class="u-tarea" id="remark">{$info.remark}</textarea></div></td>
                            </tr>
                        </tbody>
                    </table>
                    <div class="m-form-btn"><input type="hidden" name="id" value="{$info.id}" /><button id="j_btn" class="u-btn">确定提交</button></div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}